html.theme-dark {
  @import 'theme-dark-palette'

  color-scheme dark

  &,
  div#app,
  header,
  div.links,
  aside.sidebar {
    background $backgroundColor
  }

  body {
    color $fontColor
    background-color $backgroundColor
  }

  a {
    color $linkFontColor
  }

  h1, h2, h3, h4, h5, h6, p {
    border-bottom-color $sectionBorderColor
  }

  #handsontable-logo {
    path {
      fill #ffffff
    }
  }

  .handsontable {
    color-scheme light
  }

  /* Navbar */
  header.navbar, aside.sidebar {
    border-color $sectionBorderColor

    /* Navbar links */
    & .nav-link {
      color $fontColor !important
      &::after {
        border-left-color $fontColor !important
      }
    }
  }

  /* Searchbox */
  .search-box.search-box {
    input {
      background $searchBoxBackground versionedUrl('/docs/{docsVersion}/img/search.svg') 0.6rem 0.5rem no-repeat
      background-size 1rem
      border-color $searchBoxInputBorderColor
      color $fontColor

      &:focus {
        border-color $accentColor
      }

      @media (max-width: $MQNavbarNarrow) {
        border-color transparent
        background-color transparent

      }
    }

    .searchbox-search-icon {
      stroke $searchBoxIconColor
    }

    // results
    ul.suggestions {
      background-color $backgroundColor
      border-color #2d2d30

      li {
        &:not(.suggestion) {
          border-color #3e3e42

        }
        &.suggestion {
          span {
            color $fontColor
          }
          &.focused {
            background-color $sidebarSelectedBackgroundColor
            color $linkFontColor
          }
        }
      }
    }
  }


  /* Dropdown */
  .dropdown-wrapper {
    & .title {
      color $fontColor
    }
    & .arrow.down {
      border-top-color $fontColor
    }
    .nav-dropdown {
      background-color $backgroundColor
      border-color $sectionBorderColor
    }
  }

  /* Sidebar */
  .sidebar {
    scrollbar($scrollbarBackgroundColor, $scrollbarThumbColor, $scrollbarThumbColorHover)
    border-right-color $sectionBorderColor

    // sidebar collapsible headings
    & .sidebar-heading {
      color $fontColor

      & .arrow,
      & .arrow-down {
        border-color $fontColor
      }
    }

    // links in the sidebar
    & a.sidebar-link {
      color $fontColor

      &:hover {
        background $sidebarSelectedBackgroundColor
      }

      &.active {
        background $sidebarSelectedBackgroundColor
      }
    }

    .sidebar-group {
      &:not(.collapsable) .sidebar-heading:not(.clickable) {
        cursor auto
        color $fontColor
      }
    }
  }

  /* Table of contents */
  .table-of-contents {
    scrollbar($scrollbarBackgroundColor, $scrollbarThumbColor, $scrollbarThumbColorHover)
    border-left-color $sectionBorderColor

    .toc-container-header {
      color $fontColor
    }

    a {
      color $fontColor

      &.active {
        color: $fontColor
        font-weight bold
      }

      &:hover {
        color $fontColor
      }
    }
  }

  /* Tabs component */
  .tabs-component {
    border-color $tabsComponentBorderColor

    ul.tabs-component-tabs {
      border-bottom-color $tabsComponentBorderColor
      background $tabsComponentBackgroundColor

      .tabs-component-tab {
        a {
          color $fontColor

          &:hover {
            color $linkFontColor
          }
        }

        &.is-disabled a {
          color $fontColorDisabled
        }
      }
    }

    .tabs-component-panels {
      background-color $tabsComponentPanels
      border-radius 0

      &.selected-preview {
        color-scheme light
        color $tabsComponentBackgroundColor /* Related to issue #8355 */
        background-color white; /* Related to issue #8355 */
      }

      section {
        &[id*="preview-"] {
          color $tabsComponentBackgroundColor /* Related to issue #8355 */
          background-color white; /* Related to issue #8355 */
        }

        &#code {
          pre {
            scrollbar($scrollbarBackgroundColor, $scrollbarThumbColor, $scrollbarThumbColorHover)
          }
        }

        &#html {
          pre {
            scrollbar($scrollbarBackgroundColor, $scrollbarThumbColor, $scrollbarThumbColorHover)
          }
        }
      }
    }
  }

  /* A navigation element containing clickable fields (columns) */
  .row-items-container {
    .row-item {
      border-color $rowItemBorderColor
      color $fontColor

      &:hover {
        box-shadow 0 3px 12px $rowItemShadowColor
      }
    }
  }

  /* inline SVG icon  */
  .icon.outbound {
    color $fontColor
  }

  .icons-wrapper svg {
    fill: $fontColor
  }

  /* Tip markdown component */
  .custom-block.tip {
    background-color $customBlockTipBackgroundColor
  }

  /* Every custom block component */
  .custom-block {
    color $fontColor
  }

  /* Details markdown component */
  .custom-block.details {
    background-color #111111
  }

  /* Code element */
  code:not(.selected-preview *):not(pre *) {
    color $codeFontColor
    background $codeBackground
  }

  /* Language specific code blocks */
  div[class*="language-"] {
    pre {
      scrollbar($scrollbarBackgroundColor, $scrollbarThumbColor, $scrollbarThumbColorHover)
    }
  }

  /* KBD element */
  kbd {
    color $kbdFontColor
    background $kbdBackgroundColor
    border-color $kbdBorderColor
  }

  /* Version alert badge */
  .version-alert {
    border-color $versionAlertBorderColor

    p {
      color $fontColor
    }
  }

  /* Table styling starts */
  .scrollable-table {
    scrollbar($scrollbarBackgroundColor, $scrollbarThumbColor, $scrollbarThumbColorHover)
  }

  table:not(.selected-preview *):not(.pika-table):not(.htCore) {
    tr:nth-child(2n) {
      background-color $tableEvenRowBackgroundColor
    }

    th, td {
      border-bottom 1px solid $sectionBorderColor
    }
  }
  /* Table styling ends */

  /* Bottom navigation (below footer) */
  .page-nav {
    .inner {
      border-color $sectionBorderColor
    }
  }

  /* Footer */
  footer.page-edit {
    .edit-link {
      a {
        color $fontColor
      }
    }

    .last-updated {
      color $fontColor
    }
  }

  /* Cookie Consent styling starts */
  #CybotCookiebotDialog {
    background $backgroundColor
    color $fontColor
    border-top 3px solid $sectionBorderColor

    #CybotCookiebotDialogBodyContentTitle {
      color $fontColor
    }

    .CybotCookiebotDialogBodyLink {
      color $fontColor
    }
  }

  #CybotCookiebotDialogDetailBodyContentTextOverview,
  .CybotCookiebotDialogDetailBodyContentTab,
  .CybotCookiebotDialogDetailBodyContentTabsItemSelected,
  .CybotCookiebotDialogDetailBodyContentCookieContainerTypes,
  .CybotCookiebotDialogDetailBodyContentCookieTypeTable thead th,
  .CybotCookiebotDialogDetailBodyContentCookieTypeTable tbody td a,
  .CybotCookiebotDialogDetailBodyContentTab,
  #CybotCookiebotDialogDetailFooter,
  #CybotCookiebotDialogDetailBodyContent,
  #CybotCookiebotDialogDetail {
    background $backgroundColor !important
    color $fontColor !important
    border-color $sectionBorderColor

    &:hover {
      color $fontColor !important
      background $backgroundColor !important
      border-color $sectionBorderColor
    }
  }

  #CybotCookiebotDialogDetailBodyContentCookieContainerTypeDetails, #CybotCookiebotDialogDetailBodyContentTextAbout {
    scrollbar($scrollbarBackgroundColor, $scrollbarThumbColor, $scrollbarThumbColorHover)
  }

  .CybotCookiebotDialogDetailBodyContentCookieContainerTypes {
    &:hover {
      border-color $sectionBorderColor
      color $fontColor !important
      background $sidebarSelectedBackgroundColor !important
    }
  }

  .CybotCookiebotDialogDetailBodyContentCookieContainerTypesSelected, .CybotCookiebotDialogDetailBodyContentTab.CybotCookiebotDialogDetailBodyContentTabsItemSelected {
    background $sidebarSelectedBackgroundColor
    border-color $sectionBorderColor
    color $fontColor !important

    &:hover, &:focus {
      border-color $sectionBorderColor !important
      color $fontColor !important
      background $sidebarSelectedBackgroundColor !important
    }
  }

  #CybotCookiebotDialogDetail {
    table td {
      color $fontColor !important
      border-color $sectionBorderColor
    }

    .CybotCookiebotDialogDetailBodyContentTab {
      border-color $sectionBorderColor
    }
  }
  /* Cookie Consent styling ends */
}
